﻿/*
Copyright (c) 2008 William Duff

Permission is hereby granted, free of charge, to any person obtaining a copy 
of this software and associated documentation files (the "Software"), to deal 
in the Software without restriction, including without limitation the rights 
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all 
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
SOFTWARE.
*/

using System;
using System.Collections.Generic;
using System.Text;

namespace LiveUpload.Facebook
{
    public class Photo
    {
        #region Constructors

        /// <summary>
        /// Constructs a Photo object to represent a photo on Facebook.
        /// </summary>
        public Photo(string id, string albumId, string ownerId, string src, string srcBig, 
            string srcSmall, string link, string caption, double createdUnixTimestamp)
        {
            this.id = id;
            this.albumId = albumId;
            this.ownerId = ownerId;
            this.src = src;
            this.srcBig = srcBig;
            this.srcSmall = srcSmall;
            this.link = link;
            this.caption = caption;
            this.created = FacebookParser.ConvertFromUnixTimestamp(createdUnixTimestamp);
            this.createdUnixTimestamp = createdUnixTimestamp;
        }

        #endregion

        #region Private Fields

        private string id;
        private string albumId;
        private string ownerId;
        private string src;
        private string srcBig;
        private string srcSmall;
        private string link;
        private string caption;
        private DateTime? created;
        private double createdUnixTimestamp;

        #endregion

        #region Public Fields

        /// <summary>
        /// A unique identifier for the photo.
        /// </summary>
        public string Id
        {
            get { return this.id; }
            set { this.id = value; }
        }

        /// <summary>
        /// The id of the album containing this photo.
        /// </summary>
        public string AlbumId
        {
            get { return this.albumId; }
            set { this.albumId = value; }
        }

        /// <summary>
        /// The user id of the owner of the photo.
        /// </summary>
        public string OwnerId
        {
            get { return this.ownerId; }
            set { this.ownerId = value; }
        }

        /// <summary>
        /// A direct URL to the photo.
        /// </summary>
        public string Src
        {
            get { return this.src; }
            set { this.src = value; }
        }
        /// <summary>
        /// A direct URL to a big version of the photo.
        /// </summary>
        public string SrcBig
        {
            get { return this.srcBig; }
            set { this.srcBig = value; }
        }
        /// <summary>
        /// A direct URL to small version of the photo.
        /// </summary>
        public string SrcSmall
        {
            get { return this.srcSmall; }
            set { this.srcSmall = value; }
        }

        /// <summary>
        /// The URL to the photo page on Facebook.
        /// </summary>
        public string Link
        {
            get { return this.link; }
            set { this.link = value; }
        }

        /// <summary>
        /// A description of the photo.
        /// </summary>
        public string Caption
        {
            get { return this.caption; }
            set { this.caption = value; }
        }

        /// <summary>
        /// The date the photo was created. Null means it has not been created yet.
        /// </summary>
        public DateTime? Created
        {
            get { return this.created; }
            set { this.created = value; }
        }

        /// <summary>
        /// The date the photo was created in Unix time. Zero means it has not been created yet.
        /// </summary>
        public double CreatedUnixTimestamp
        {
            get { return this.createdUnixTimestamp; }
            set { this.createdUnixTimestamp = value; }
        }

        #endregion
    }
}
